{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d364ca1f-f107-4f04-a826-a6ad023a6397",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "path_ml = '/home/tinker/bbserverless/DIC/MachineLearning/Inference-of-ml-openfaas/'\n",
    "path_bigdata= '/home/tinker/bbserverless/DIC/BigData/openfaas/'\n",
    "path_stream='/home/tinker/bbserverless/DIC/Stream/openfaas/'\n",
    "path_web='/home/tinker/bbserverless/DIC/WebServices/openfaas/python-code/'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "5efa99d2-7a74-4641-bd8a-76e6a8d10c05",
   "metadata": {},
   "outputs": [],
   "source": [
    "def update_openfaas(path):\n",
    "    os.chdir(path)\n",
    "    current_path = os.getcwd()\n",
    "    print(current_path)\n",
    "    build = 'action_build.sh'\n",
    "    r = os.popen('bash '+build).read()\n",
    "    print(r)\n",
    "    push = 'action_push.sh'\n",
    "    r = os.popen('bash '+push).read()\n",
    "    print(r)\n",
    "    deploy = 'action_deploy.sh'\n",
    "    r = os.popen('bash '+deploy).read()\n",
    "    print(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dfcb2e7f-8e6a-4a82-bfa8-a886fca752d7",
   "metadata": {},
   "outputs": [],
   "source": [
    "update_openfaas(path_ml)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f0c4520f-abf2-437b-bf3a-82ddbd9e4bda",
   "metadata": {},
   "outputs": [],
   "source": [
    "update_openfaas(path_bigdata)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e755dead-7dea-47a6-acc9-43954a9b4d43",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/tinker/bbserverless/DIC/Stream/openfaas\n",
      "\u001b[33m[0] > Building stream.\n",
      "\u001b[0mClearing temporary build folder: ./build/stream/\n",
      "Preparing: ./stream/ build/stream/function\n",
      "Building: k.harbor.siat.ac.cn/openfaas/openfaas-stream:1.0.0 with python3-debian template. Please wait..\n",
      "Sending build context to Docker daemon  752.6kB\n",
      "\n",
      "Step 1/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.5 as watchdog\n",
      " ---> c164772f02dd\n",
      "Step 2/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3\n",
      " ---> d92f72c38f7e\n",
      "Step 3/31 : ARG TARGETPLATFORM\n",
      " ---> Using cache\n",
      " ---> e00f61674146\n",
      "Step 4/31 : ARG BUILDPLATFORM\n",
      " ---> Using cache\n",
      " ---> 722c479ed618\n",
      "Step 5/31 : ARG ADDITIONAL_PACKAGE\n",
      " ---> Using cache\n",
      " ---> c86c24813247\n",
      "Step 6/31 : COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> d1fe1c3e1b5f\n",
      "Step 7/31 : RUN chmod +x /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> 0b6b88a165e1\n",
      "Step 8/31 : RUN apt-get update     && apt-get install -y ca-certificates ${ADDITIONAL_PACKAGE}     && rm -rf /var/lib/apt/lists/\n",
      " ---> Using cache\n",
      " ---> c6861909e3ed\n",
      "Step 9/31 : RUN groupadd app && useradd -r -g app app\n",
      " ---> Using cache\n",
      " ---> df67458fdd24\n",
      "Step 10/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 83f0d8b6adec\n",
      "Step 11/31 : COPY index.py           .\n",
      " ---> Using cache\n",
      " ---> d9690e2d06bc\n",
      "Step 12/31 : COPY requirements.txt   .\n",
      " ---> Using cache\n",
      " ---> b4fe231e2d0e\n",
      "Step 13/31 : RUN chown -R app /home/app &&     mkdir -p /home/app/python && chown -R app /home/app\n",
      " ---> Using cache\n",
      " ---> efa8bb4460b9\n",
      "Step 14/31 : USER app\n",
      " ---> Using cache\n",
      " ---> 0c90d7ed85c2\n",
      "Step 15/31 : ENV PATH=$PATH:/home/app/.local/bin:/home/app/python/bin/\n",
      " ---> Using cache\n",
      " ---> e156054e806e\n",
      "Step 16/31 : ENV PYTHONPATH=$PYTHONPATH:/home/app/python\n",
      " ---> Using cache\n",
      " ---> 289cf0e0a18b\n",
      "Step 17/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 6b4b8a2ea1c5\n",
      "Step 18/31 : RUN mkdir -p function\n",
      " ---> Using cache\n",
      " ---> 57e56b7cd55c\n",
      "Step 19/31 : RUN touch ./function/__init__.py\n",
      " ---> Using cache\n",
      " ---> 7536201118a2\n",
      "Step 20/31 : WORKDIR /home/app/function/\n",
      " ---> Using cache\n",
      " ---> a9d9213cc629\n",
      "Step 21/31 : COPY function/requirements.txt\t.\n",
      " ---> Using cache\n",
      " ---> e5d746186ed6\n",
      "Step 22/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 98f8e020f665\n",
      "Step 23/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 2e6c6f655c2c\n",
      "Step 24/31 : USER root\n",
      " ---> Using cache\n",
      " ---> b24027401a4b\n",
      "Step 25/31 : COPY function           function\n",
      " ---> Using cache\n",
      " ---> 1f8ad283f6b7\n",
      "Step 26/31 : RUN chown -R app:app ./ &&     chmod -R 777 /home/app/python\n",
      " ---> Using cache\n",
      " ---> 71b438220f71\n",
      "Step 27/31 : USER app\n",
      " ---> Using cache\n",
      " ---> e41f020594d6\n",
      "Step 28/31 : ENV fprocess=\"python3 index.py\"\n",
      " ---> Using cache\n",
      " ---> 5c40a2359844\n",
      "Step 29/31 : EXPOSE 8080\n",
      " ---> Using cache\n",
      " ---> 2de46f808e24\n",
      "Step 30/31 : HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1\n",
      " ---> Using cache\n",
      " ---> 10a6c4b5251a\n",
      "Step 31/31 : CMD [\"fwatchdog\"]\n",
      " ---> Using cache\n",
      " ---> 6c006d1d7456\n",
      "Successfully built 6c006d1d7456\n",
      "Successfully tagged k.harbor.siat.ac.cn/openfaas/openfaas-stream:1.0.0\n",
      "Image: k.harbor.siat.ac.cn/openfaas/openfaas-stream:1.0.0 built.\n",
      "\u001b[33m[0] < Building stream done in 1.40s.\n",
      "\u001b[0m\u001b[33m[0] Worker done.\n",
      "\u001b[0m\n",
      "\u001b[33mTotal build time: 1.40s\u001b[0m\n",
      "\n",
      "\u001b[33m[0] > Pushing stream [k.harbor.siat.ac.cn/openfaas/openfaas-stream:1.0.0].\n",
      "\u001b[0mThe push refers to repository [k.harbor.siat.ac.cn/openfaas/openfaas-stream]\n",
      "c4ebc90fe096: Preparing\n",
      "39c3b70a4302: Preparing\n",
      "7874115f26a8: Preparing\n",
      "a0c05c58eae6: Preparing\n",
      "d9f89be3ea66: Preparing\n",
      "cc70af984b15: Preparing\n",
      "8630709fc03e: Preparing\n",
      "ff86a3cd7300: Preparing\n",
      "e1dcdd9b46b6: Preparing\n",
      "8630709fc03e: Waiting\n",
      "a4337db26919: Preparing\n",
      "2dfe3c85b996: Preparing\n",
      "ff86a3cd7300: Waiting\n",
      "f5f847464d89: Preparing\n",
      "4c488a561d6f: Preparing\n",
      "6c021b160968: Preparing\n",
      "cc70af984b15: Waiting\n",
      "f5f847464d89: Waiting\n",
      "6c021b160968: Preparing\n",
      "4c488a561d6f: Waiting\n",
      "cd6b2a9ae627: Preparing\n",
      "84c97f2e3099: Preparing\n",
      "b0cb6a43f300: Preparing\n",
      "a4337db26919: Waiting\n",
      "cd6b2a9ae627: Waiting\n",
      "4b4c002ee6ca: Preparing\n",
      "84c97f2e3099: Waiting\n",
      "cdc9dae211b4: Preparing\n",
      "6c021b160968: Waiting\n",
      "b0cb6a43f300: Waiting\n",
      "4b4c002ee6ca: Waiting\n",
      "7095af798ace: Preparing\n",
      "e1dcdd9b46b6: Waiting\n",
      "fe6a4fdbedc0: Preparing\n",
      "e4d0e810d54a: Preparing\n",
      "4e006334a6fd: Preparing\n",
      "7095af798ace: Waiting\n",
      "fe6a4fdbedc0: Waiting\n",
      "e4d0e810d54a: Waiting\n",
      "4e006334a6fd: Waiting\n",
      "d9f89be3ea66: Layer already exists\n",
      "a0c05c58eae6: Layer already exists\n",
      "7874115f26a8: Layer already exists\n",
      "39c3b70a4302: Layer already exists\n",
      "c4ebc90fe096: Layer already exists\n",
      "8630709fc03e: Layer already exists\n",
      "cc70af984b15: Layer already exists\n",
      "ff86a3cd7300: Layer already exists\n",
      "a4337db26919: Layer already exists\n",
      "e1dcdd9b46b6: Layer already exists\n",
      "2dfe3c85b996: Layer already exists\n",
      "f5f847464d89: Layer already exists\n",
      "cd6b2a9ae627: Layer already exists\n",
      "6c021b160968: Layer already exists\n",
      "4c488a561d6f: Layer already exists\n",
      "84c97f2e3099: Layer already exists\n",
      "b0cb6a43f300: Layer already exists\n",
      "4b4c002ee6ca: Layer already exists\n",
      "cdc9dae211b4: Layer already exists\n",
      "7095af798ace: Layer already exists\n",
      "fe6a4fdbedc0: Layer already exists\n",
      "e4d0e810d54a: Layer already exists\n",
      "4e006334a6fd: Layer already exists\n",
      "1.0.0: digest: sha256:35e87f64cb620cd9fb7c8e5bce9c55ba3e70e900af19374bc52e007aec82dc2d size: 5342\n",
      "\u001b[33m[0] < Pushing stream [k.harbor.siat.ac.cn/openfaas/openfaas-stream:1.0.0] done.\n",
      "\u001b[0m\u001b[33m[0] Worker done.\n",
      "\u001b[0m\n",
      "Deploying: stream.\n",
      "WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS.\n",
      "\n",
      "Deployed. 202 Accepted.\n",
      "URL: http://serverless.siat.ac.cn:31112/function/stream\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "update_openfaas(path_stream)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "5d02bf04-b63f-4421-9bf3-d23bfe0c223d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/tinker/bbserverless/DIC/WebServices/openfaas/python-code\n",
      "\u001b[33m[0] > Building hello-python.\n",
      "\u001b[0mClearing temporary build folder: ./build/hello-python/\n",
      "Preparing: ./hello/ build/hello-python/function\n",
      "Building: k.harbor.siat.ac.cn/openfaas/python-hello:1.0.0 with python3-debian template. Please wait..\n",
      "Sending build context to Docker daemon  8.192kB\n",
      "\n",
      "Step 1/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.5 as watchdog\n",
      " ---> c164772f02dd\n",
      "Step 2/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3\n",
      " ---> d92f72c38f7e\n",
      "Step 3/31 : ARG TARGETPLATFORM\n",
      " ---> Using cache\n",
      " ---> e00f61674146\n",
      "Step 4/31 : ARG BUILDPLATFORM\n",
      " ---> Using cache\n",
      " ---> 722c479ed618\n",
      "Step 5/31 : ARG ADDITIONAL_PACKAGE\n",
      " ---> Using cache\n",
      " ---> c86c24813247\n",
      "Step 6/31 : COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> d1fe1c3e1b5f\n",
      "Step 7/31 : RUN chmod +x /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> 0b6b88a165e1\n",
      "Step 8/31 : RUN apt-get update     && apt-get install -y ca-certificates ${ADDITIONAL_PACKAGE}     && rm -rf /var/lib/apt/lists/\n",
      " ---> Using cache\n",
      " ---> c6861909e3ed\n",
      "Step 9/31 : RUN groupadd app && useradd -r -g app app\n",
      " ---> Using cache\n",
      " ---> df67458fdd24\n",
      "Step 10/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 83f0d8b6adec\n",
      "Step 11/31 : COPY index.py           .\n",
      " ---> Using cache\n",
      " ---> d9690e2d06bc\n",
      "Step 12/31 : COPY requirements.txt   .\n",
      " ---> Using cache\n",
      " ---> b4fe231e2d0e\n",
      "Step 13/31 : RUN chown -R app /home/app &&     mkdir -p /home/app/python && chown -R app /home/app\n",
      " ---> Using cache\n",
      " ---> efa8bb4460b9\n",
      "Step 14/31 : USER app\n",
      " ---> Using cache\n",
      " ---> 0c90d7ed85c2\n",
      "Step 15/31 : ENV PATH=$PATH:/home/app/.local/bin:/home/app/python/bin/\n",
      " ---> Using cache\n",
      " ---> e156054e806e\n",
      "Step 16/31 : ENV PYTHONPATH=$PYTHONPATH:/home/app/python\n",
      " ---> Using cache\n",
      " ---> 289cf0e0a18b\n",
      "Step 17/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 6b4b8a2ea1c5\n",
      "Step 18/31 : RUN mkdir -p function\n",
      " ---> Using cache\n",
      " ---> 57e56b7cd55c\n",
      "Step 19/31 : RUN touch ./function/__init__.py\n",
      " ---> Using cache\n",
      " ---> 7536201118a2\n",
      "Step 20/31 : WORKDIR /home/app/function/\n",
      " ---> Using cache\n",
      " ---> a9d9213cc629\n",
      "Step 21/31 : COPY function/requirements.txt\t.\n",
      " ---> Using cache\n",
      " ---> e5d746186ed6\n",
      "Step 22/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 98f8e020f665\n",
      "Step 23/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 2e6c6f655c2c\n",
      "Step 24/31 : USER root\n",
      " ---> Using cache\n",
      " ---> b24027401a4b\n",
      "Step 25/31 : COPY function           function\n",
      " ---> Using cache\n",
      " ---> 3c32c164421a\n",
      "Step 26/31 : RUN chown -R app:app ./ &&     chmod -R 777 /home/app/python\n",
      " ---> Using cache\n",
      " ---> 1a119e17576a\n",
      "Step 27/31 : USER app\n",
      " ---> Using cache\n",
      " ---> a915daad1908\n",
      "Step 28/31 : ENV fprocess=\"python3 index.py\"\n",
      " ---> Using cache\n",
      " ---> 93728a7300ff\n",
      "Step 29/31 : EXPOSE 8080\n",
      " ---> Using cache\n",
      " ---> d19f4e383365\n",
      "Step 30/31 : HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1\n",
      " ---> Using cache\n",
      " ---> e2a150ae5336\n",
      "Step 31/31 : CMD [\"fwatchdog\"]\n",
      " ---> Using cache\n",
      " ---> 28599375e67e\n",
      "Successfully built 28599375e67e\n",
      "Successfully tagged k.harbor.siat.ac.cn/openfaas/python-hello:1.0.0\n",
      "Image: k.harbor.siat.ac.cn/openfaas/python-hello:1.0.0 built.\n",
      "\u001b[33m[0] < Building hello-python done in 2.14s.\n",
      "\u001b[0m\u001b[33m[0] > Building hash-python.\n",
      "\u001b[0mClearing temporary build folder: ./build/hash-python/\n",
      "Preparing: ./hash/ build/hash-python/function\n",
      "Building: k.harbor.siat.ac.cn/openfaas/python-hash:1.0.0 with python3-debian template. Please wait..\n",
      "Sending build context to Docker daemon  8.192kB\n",
      "\n",
      "Step 1/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.5 as watchdog\n",
      " ---> c164772f02dd\n",
      "Step 2/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3\n",
      " ---> d92f72c38f7e\n",
      "Step 3/31 : ARG TARGETPLATFORM\n",
      " ---> Using cache\n",
      " ---> e00f61674146\n",
      "Step 4/31 : ARG BUILDPLATFORM\n",
      " ---> Using cache\n",
      " ---> 722c479ed618\n",
      "Step 5/31 : ARG ADDITIONAL_PACKAGE\n",
      " ---> Using cache\n",
      " ---> c86c24813247\n",
      "Step 6/31 : COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> d1fe1c3e1b5f\n",
      "Step 7/31 : RUN chmod +x /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> 0b6b88a165e1\n",
      "Step 8/31 : RUN apt-get update     && apt-get install -y ca-certificates ${ADDITIONAL_PACKAGE}     && rm -rf /var/lib/apt/lists/\n",
      " ---> Using cache\n",
      " ---> c6861909e3ed\n",
      "Step 9/31 : RUN groupadd app && useradd -r -g app app\n",
      " ---> Using cache\n",
      " ---> df67458fdd24\n",
      "Step 10/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 83f0d8b6adec\n",
      "Step 11/31 : COPY index.py           .\n",
      " ---> Using cache\n",
      " ---> d9690e2d06bc\n",
      "Step 12/31 : COPY requirements.txt   .\n",
      " ---> Using cache\n",
      " ---> b4fe231e2d0e\n",
      "Step 13/31 : RUN chown -R app /home/app &&     mkdir -p /home/app/python && chown -R app /home/app\n",
      " ---> Using cache\n",
      " ---> efa8bb4460b9\n",
      "Step 14/31 : USER app\n",
      " ---> Using cache\n",
      " ---> 0c90d7ed85c2\n",
      "Step 15/31 : ENV PATH=$PATH:/home/app/.local/bin:/home/app/python/bin/\n",
      " ---> Using cache\n",
      " ---> e156054e806e\n",
      "Step 16/31 : ENV PYTHONPATH=$PYTHONPATH:/home/app/python\n",
      " ---> Using cache\n",
      " ---> 289cf0e0a18b\n",
      "Step 17/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 6b4b8a2ea1c5\n",
      "Step 18/31 : RUN mkdir -p function\n",
      " ---> Using cache\n",
      " ---> 57e56b7cd55c\n",
      "Step 19/31 : RUN touch ./function/__init__.py\n",
      " ---> Using cache\n",
      " ---> 7536201118a2\n",
      "Step 20/31 : WORKDIR /home/app/function/\n",
      " ---> Using cache\n",
      " ---> a9d9213cc629\n",
      "Step 21/31 : COPY function/requirements.txt\t.\n",
      " ---> Using cache\n",
      " ---> e5d746186ed6\n",
      "Step 22/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 98f8e020f665\n",
      "Step 23/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 2e6c6f655c2c\n",
      "Step 24/31 : USER root\n",
      " ---> Using cache\n",
      " ---> b24027401a4b\n",
      "Step 25/31 : COPY function           function\n",
      " ---> Using cache\n",
      " ---> c2b37dbaa1f2\n",
      "Step 26/31 : RUN chown -R app:app ./ &&     chmod -R 777 /home/app/python\n",
      " ---> Using cache\n",
      " ---> 496fbd16298a\n",
      "Step 27/31 : USER app\n",
      " ---> Using cache\n",
      " ---> eca497600596\n",
      "Step 28/31 : ENV fprocess=\"python3 index.py\"\n",
      " ---> Using cache\n",
      " ---> 4870d3a3ab84\n",
      "Step 29/31 : EXPOSE 8080\n",
      " ---> Using cache\n",
      " ---> c3fd59435498\n",
      "Step 30/31 : HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1\n",
      " ---> Using cache\n",
      " ---> 5d92c0482c70\n",
      "Step 31/31 : CMD [\"fwatchdog\"]\n",
      " ---> Using cache\n",
      " ---> 27e1c24ca13b\n",
      "Successfully built 27e1c24ca13b\n",
      "Successfully tagged k.harbor.siat.ac.cn/openfaas/python-hash:1.0.0\n",
      "Image: k.harbor.siat.ac.cn/openfaas/python-hash:1.0.0 built.\n",
      "\u001b[33m[0] < Building hash-python done in 0.80s.\n",
      "\u001b[0m\u001b[33m[0] > Building sort-python.\n",
      "\u001b[0mClearing temporary build folder: ./build/sort-python/\n",
      "Preparing: ./sort/ build/sort-python/function\n",
      "Building: k.harbor.siat.ac.cn/openfaas/python-sort:1.0.0 with python3-debian template. Please wait..\n",
      "Sending build context to Docker daemon  8.704kB\n",
      "\n",
      "Step 1/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.5 as watchdog\n",
      " ---> c164772f02dd\n",
      "Step 2/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3\n",
      " ---> d92f72c38f7e\n",
      "Step 3/31 : ARG TARGETPLATFORM\n",
      " ---> Using cache\n",
      " ---> e00f61674146\n",
      "Step 4/31 : ARG BUILDPLATFORM\n",
      " ---> Using cache\n",
      " ---> 722c479ed618\n",
      "Step 5/31 : ARG ADDITIONAL_PACKAGE\n",
      " ---> Using cache\n",
      " ---> c86c24813247\n",
      "Step 6/31 : COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> d1fe1c3e1b5f\n",
      "Step 7/31 : RUN chmod +x /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> 0b6b88a165e1\n",
      "Step 8/31 : RUN apt-get update     && apt-get install -y ca-certificates ${ADDITIONAL_PACKAGE}     && rm -rf /var/lib/apt/lists/\n",
      " ---> Using cache\n",
      " ---> c6861909e3ed\n",
      "Step 9/31 : RUN groupadd app && useradd -r -g app app\n",
      " ---> Using cache\n",
      " ---> df67458fdd24\n",
      "Step 10/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 83f0d8b6adec\n",
      "Step 11/31 : COPY index.py           .\n",
      " ---> Using cache\n",
      " ---> d9690e2d06bc\n",
      "Step 12/31 : COPY requirements.txt   .\n",
      " ---> Using cache\n",
      " ---> b4fe231e2d0e\n",
      "Step 13/31 : RUN chown -R app /home/app &&     mkdir -p /home/app/python && chown -R app /home/app\n",
      " ---> Using cache\n",
      " ---> efa8bb4460b9\n",
      "Step 14/31 : USER app\n",
      " ---> Using cache\n",
      " ---> 0c90d7ed85c2\n",
      "Step 15/31 : ENV PATH=$PATH:/home/app/.local/bin:/home/app/python/bin/\n",
      " ---> Using cache\n",
      " ---> e156054e806e\n",
      "Step 16/31 : ENV PYTHONPATH=$PYTHONPATH:/home/app/python\n",
      " ---> Using cache\n",
      " ---> 289cf0e0a18b\n",
      "Step 17/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 6b4b8a2ea1c5\n",
      "Step 18/31 : RUN mkdir -p function\n",
      " ---> Using cache\n",
      " ---> 57e56b7cd55c\n",
      "Step 19/31 : RUN touch ./function/__init__.py\n",
      " ---> Using cache\n",
      " ---> 7536201118a2\n",
      "Step 20/31 : WORKDIR /home/app/function/\n",
      " ---> Using cache\n",
      " ---> a9d9213cc629\n",
      "Step 21/31 : COPY function/requirements.txt\t.\n",
      " ---> Using cache\n",
      " ---> e5d746186ed6\n",
      "Step 22/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 98f8e020f665\n",
      "Step 23/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 2e6c6f655c2c\n",
      "Step 24/31 : USER root\n",
      " ---> Using cache\n",
      " ---> b24027401a4b\n",
      "Step 25/31 : COPY function           function\n",
      " ---> Using cache\n",
      " ---> 6b705d5d3457\n",
      "Step 26/31 : RUN chown -R app:app ./ &&     chmod -R 777 /home/app/python\n",
      " ---> Using cache\n",
      " ---> 33650690d0e9\n",
      "Step 27/31 : USER app\n",
      " ---> Using cache\n",
      " ---> ee36e97d2730\n",
      "Step 28/31 : ENV fprocess=\"python3 index.py\"\n",
      " ---> Using cache\n",
      " ---> 02639022b118\n",
      "Step 29/31 : EXPOSE 8080\n",
      " ---> Using cache\n",
      " ---> 1aaa0eb6aab3\n",
      "Step 30/31 : HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1\n",
      " ---> Using cache\n",
      " ---> 930a42d17545\n",
      "Step 31/31 : CMD [\"fwatchdog\"]\n",
      " ---> Using cache\n",
      " ---> 41f506db206c\n",
      "Successfully built 41f506db206c\n",
      "Successfully tagged k.harbor.siat.ac.cn/openfaas/python-sort:1.0.0\n",
      "Image: k.harbor.siat.ac.cn/openfaas/python-sort:1.0.0 built.\n",
      "\u001b[33m[0] < Building sort-python done in 0.94s.\n",
      "\u001b[0m\u001b[33m[0] > Building md5-python.\n",
      "\u001b[0mClearing temporary build folder: ./build/md5-python/\n",
      "Preparing: ./Md5/ build/md5-python/function\n",
      "Building: k.harbor.siat.ac.cn/openfaas/python-md5:1.0.0 with python3-debian template. Please wait..\n",
      "Sending build context to Docker daemon  8.192kB\n",
      "\n",
      "Step 1/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.5 as watchdog\n",
      " ---> c164772f02dd\n",
      "Step 2/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3\n",
      " ---> d92f72c38f7e\n",
      "Step 3/31 : ARG TARGETPLATFORM\n",
      " ---> Using cache\n",
      " ---> e00f61674146\n",
      "Step 4/31 : ARG BUILDPLATFORM\n",
      " ---> Using cache\n",
      " ---> 722c479ed618\n",
      "Step 5/31 : ARG ADDITIONAL_PACKAGE\n",
      " ---> Using cache\n",
      " ---> c86c24813247\n",
      "Step 6/31 : COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> d1fe1c3e1b5f\n",
      "Step 7/31 : RUN chmod +x /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> 0b6b88a165e1\n",
      "Step 8/31 : RUN apt-get update     && apt-get install -y ca-certificates ${ADDITIONAL_PACKAGE}     && rm -rf /var/lib/apt/lists/\n",
      " ---> Using cache\n",
      " ---> c6861909e3ed\n",
      "Step 9/31 : RUN groupadd app && useradd -r -g app app\n",
      " ---> Using cache\n",
      " ---> df67458fdd24\n",
      "Step 10/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 83f0d8b6adec\n",
      "Step 11/31 : COPY index.py           .\n",
      " ---> Using cache\n",
      " ---> d9690e2d06bc\n",
      "Step 12/31 : COPY requirements.txt   .\n",
      " ---> Using cache\n",
      " ---> b4fe231e2d0e\n",
      "Step 13/31 : RUN chown -R app /home/app &&     mkdir -p /home/app/python && chown -R app /home/app\n",
      " ---> Using cache\n",
      " ---> efa8bb4460b9\n",
      "Step 14/31 : USER app\n",
      " ---> Using cache\n",
      " ---> 0c90d7ed85c2\n",
      "Step 15/31 : ENV PATH=$PATH:/home/app/.local/bin:/home/app/python/bin/\n",
      " ---> Using cache\n",
      " ---> e156054e806e\n",
      "Step 16/31 : ENV PYTHONPATH=$PYTHONPATH:/home/app/python\n",
      " ---> Using cache\n",
      " ---> 289cf0e0a18b\n",
      "Step 17/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 6b4b8a2ea1c5\n",
      "Step 18/31 : RUN mkdir -p function\n",
      " ---> Using cache\n",
      " ---> 57e56b7cd55c\n",
      "Step 19/31 : RUN touch ./function/__init__.py\n",
      " ---> Using cache\n",
      " ---> 7536201118a2\n",
      "Step 20/31 : WORKDIR /home/app/function/\n",
      " ---> Using cache\n",
      " ---> a9d9213cc629\n",
      "Step 21/31 : COPY function/requirements.txt\t.\n",
      " ---> Using cache\n",
      " ---> e5d746186ed6\n",
      "Step 22/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 98f8e020f665\n",
      "Step 23/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 2e6c6f655c2c\n",
      "Step 24/31 : USER root\n",
      " ---> Using cache\n",
      " ---> b24027401a4b\n",
      "Step 25/31 : COPY function           function\n",
      " ---> Using cache\n",
      " ---> 5be86b2e2956\n",
      "Step 26/31 : RUN chown -R app:app ./ &&     chmod -R 777 /home/app/python\n",
      " ---> Using cache\n",
      " ---> bc2bdf3dc821\n",
      "Step 27/31 : USER app\n",
      " ---> Using cache\n",
      " ---> fb0471d44c13\n",
      "Step 28/31 : ENV fprocess=\"python3 index.py\"\n",
      " ---> Using cache\n",
      " ---> 5a7f13e7a667\n",
      "Step 29/31 : EXPOSE 8080\n",
      " ---> Using cache\n",
      " ---> 5d129fa76b91\n",
      "Step 30/31 : HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1\n",
      " ---> Using cache\n",
      " ---> 4b460b2a6d69\n",
      "Step 31/31 : CMD [\"fwatchdog\"]\n",
      " ---> Using cache\n",
      " ---> f85f1ebdff97\n",
      "Successfully built f85f1ebdff97\n",
      "Successfully tagged k.harbor.siat.ac.cn/openfaas/python-md5:1.0.0\n",
      "Image: k.harbor.siat.ac.cn/openfaas/python-md5:1.0.0 built.\n",
      "\u001b[33m[0] < Building md5-python done in 0.73s.\n",
      "\u001b[0m\u001b[33m[0] > Building cryptography-python.\n",
      "\u001b[0mClearing temporary build folder: ./build/cryptography-python/\n",
      "Preparing: ./cryptography/ build/cryptography-python/function\n",
      "Building: k.harbor.siat.ac.cn/openfaas/python-cryptography:1.0.0 with python3-debian template. Please wait..\n",
      "Sending build context to Docker daemon  8.704kB\n",
      "\n",
      "Step 1/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/classic-watchdog:0.1.5 as watchdog\n",
      " ---> c164772f02dd\n",
      "Step 2/31 : FROM --platform=${TARGETPLATFORM:-linux/amd64} python:3\n",
      " ---> d92f72c38f7e\n",
      "Step 3/31 : ARG TARGETPLATFORM\n",
      " ---> Using cache\n",
      " ---> e00f61674146\n",
      "Step 4/31 : ARG BUILDPLATFORM\n",
      " ---> Using cache\n",
      " ---> 722c479ed618\n",
      "Step 5/31 : ARG ADDITIONAL_PACKAGE\n",
      " ---> Using cache\n",
      " ---> c86c24813247\n",
      "Step 6/31 : COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> d1fe1c3e1b5f\n",
      "Step 7/31 : RUN chmod +x /usr/bin/fwatchdog\n",
      " ---> Using cache\n",
      " ---> 0b6b88a165e1\n",
      "Step 8/31 : RUN apt-get update     && apt-get install -y ca-certificates ${ADDITIONAL_PACKAGE}     && rm -rf /var/lib/apt/lists/\n",
      " ---> Using cache\n",
      " ---> c6861909e3ed\n",
      "Step 9/31 : RUN groupadd app && useradd -r -g app app\n",
      " ---> Using cache\n",
      " ---> df67458fdd24\n",
      "Step 10/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 83f0d8b6adec\n",
      "Step 11/31 : COPY index.py           .\n",
      " ---> Using cache\n",
      " ---> d9690e2d06bc\n",
      "Step 12/31 : COPY requirements.txt   .\n",
      " ---> Using cache\n",
      " ---> b4fe231e2d0e\n",
      "Step 13/31 : RUN chown -R app /home/app &&     mkdir -p /home/app/python && chown -R app /home/app\n",
      " ---> Using cache\n",
      " ---> efa8bb4460b9\n",
      "Step 14/31 : USER app\n",
      " ---> Using cache\n",
      " ---> 0c90d7ed85c2\n",
      "Step 15/31 : ENV PATH=$PATH:/home/app/.local/bin:/home/app/python/bin/\n",
      " ---> Using cache\n",
      " ---> e156054e806e\n",
      "Step 16/31 : ENV PYTHONPATH=$PYTHONPATH:/home/app/python\n",
      " ---> Using cache\n",
      " ---> 289cf0e0a18b\n",
      "Step 17/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 6b4b8a2ea1c5\n",
      "Step 18/31 : RUN mkdir -p function\n",
      " ---> Using cache\n",
      " ---> 57e56b7cd55c\n",
      "Step 19/31 : RUN touch ./function/__init__.py\n",
      " ---> Using cache\n",
      " ---> 7536201118a2\n",
      "Step 20/31 : WORKDIR /home/app/function/\n",
      " ---> Using cache\n",
      " ---> a9d9213cc629\n",
      "Step 21/31 : COPY function/requirements.txt\t.\n",
      " ---> Using cache\n",
      " ---> 17c1abd66802\n",
      "Step 22/31 : RUN pip install -r requirements.txt --target=/home/app/python\n",
      " ---> Using cache\n",
      " ---> 5b562dd0e51b\n",
      "Step 23/31 : WORKDIR /home/app/\n",
      " ---> Using cache\n",
      " ---> 068b18d6cce1\n",
      "Step 24/31 : USER root\n",
      " ---> Using cache\n",
      " ---> c7e2d229356f\n",
      "Step 25/31 : COPY function           function\n",
      " ---> Using cache\n",
      " ---> 96cc14556d85\n",
      "Step 26/31 : RUN chown -R app:app ./ &&     chmod -R 777 /home/app/python\n",
      " ---> Using cache\n",
      " ---> 7ec7654243e1\n",
      "Step 27/31 : USER app\n",
      " ---> Using cache\n",
      " ---> 6d512f9e20dd\n",
      "Step 28/31 : ENV fprocess=\"python3 index.py\"\n",
      " ---> Using cache\n",
      " ---> 121637f22c15\n",
      "Step 29/31 : EXPOSE 8080\n",
      " ---> Using cache\n",
      " ---> 459c42e41116\n",
      "Step 30/31 : HEALTHCHECK --interval=3s CMD [ -e /tmp/.lock ] || exit 1\n",
      " ---> Using cache\n",
      " ---> b675bce14237\n",
      "Step 31/31 : CMD [\"fwatchdog\"]\n",
      " ---> Using cache\n",
      " ---> da491cb2614b\n",
      "Successfully built da491cb2614b\n",
      "Successfully tagged k.harbor.siat.ac.cn/openfaas/python-cryptography:1.0.0\n",
      "Image: k.harbor.siat.ac.cn/openfaas/python-cryptography:1.0.0 built.\n",
      "\u001b[33m[0] < Building cryptography-python done in 0.86s.\n",
      "\u001b[0m\u001b[33m[0] Worker done.\n",
      "\u001b[0m\n",
      "\u001b[33mTotal build time: 5.47s\u001b[0m\n",
      "\n",
      "\u001b[33m[0] > Pushing hello-python [k.harbor.siat.ac.cn/openfaas/python-hello:1.0.0].\n",
      "\u001b[0mThe push refers to repository [k.harbor.siat.ac.cn/openfaas/python-hello]\n",
      "02871403ecdb: Preparing\n",
      "b6381fb5e90d: Preparing\n",
      "7874115f26a8: Preparing\n",
      "a0c05c58eae6: Preparing\n",
      "d9f89be3ea66: Preparing\n",
      "cc70af984b15: Preparing\n",
      "8630709fc03e: Preparing\n",
      "ff86a3cd7300: Preparing\n",
      "e1dcdd9b46b6: Preparing\n",
      "a4337db26919: Preparing\n",
      "2dfe3c85b996: Preparing\n",
      "f5f847464d89: Preparing\n",
      "4c488a561d6f: Preparing\n",
      "6c021b160968: Preparing\n",
      "6c021b160968: Preparing\n",
      "cd6b2a9ae627: Preparing\n",
      "84c97f2e3099: Preparing\n",
      "b0cb6a43f300: Preparing\n",
      "4b4c002ee6ca: Preparing\n",
      "8630709fc03e: Waiting\n",
      "cdc9dae211b4: Preparing\n",
      "7095af798ace: Preparing\n",
      "fe6a4fdbedc0: Preparing\n",
      "ff86a3cd7300: Waiting\n",
      "e4d0e810d54a: Preparing\n",
      "4e006334a6fd: Preparing\n",
      "84c97f2e3099: Waiting\n",
      "4c488a561d6f: Waiting\n",
      "2dfe3c85b996: Waiting\n",
      "b0cb6a43f300: Waiting\n",
      "6c021b160968: Waiting\n",
      "f5f847464d89: Waiting\n",
      "e1dcdd9b46b6: Waiting\n",
      "a4337db26919: Waiting\n",
      "4b4c002ee6ca: Waiting\n",
      "cc70af984b15: Waiting\n",
      "cd6b2a9ae627: Waiting\n",
      "cdc9dae211b4: Waiting\n",
      "7095af798ace: Waiting\n",
      "4e006334a6fd: Waiting\n",
      "e4d0e810d54a: Waiting\n",
      "fe6a4fdbedc0: Waiting\n",
      "b6381fb5e90d: Layer already exists\n",
      "02871403ecdb: Layer already exists\n",
      "a0c05c58eae6: Layer already exists\n",
      "7874115f26a8: Layer already exists\n",
      "d9f89be3ea66: Layer already exists\n",
      "cc70af984b15: Layer already exists\n",
      "ff86a3cd7300: Layer already exists\n",
      "8630709fc03e: Layer already exists\n",
      "a4337db26919: Layer already exists\n",
      "e1dcdd9b46b6: Layer already exists\n",
      "2dfe3c85b996: Layer already exists\n",
      "f5f847464d89: Layer already exists\n",
      "4c488a561d6f: Layer already exists\n",
      "6c021b160968: Layer already exists\n",
      "cd6b2a9ae627: Layer already exists\n",
      "84c97f2e3099: Layer already exists\n",
      "b0cb6a43f300: Layer already exists\n",
      "4b4c002ee6ca: Layer already exists\n",
      "7095af798ace: Layer already exists\n",
      "cdc9dae211b4: Layer already exists\n",
      "e4d0e810d54a: Layer already exists\n",
      "fe6a4fdbedc0: Layer already exists\n",
      "4e006334a6fd: Layer already exists\n",
      "1.0.0: digest: sha256:8e4e2a81d14e2b4ca409290e5ae60e8db7dd4fc4669b647d831a02d028b1958c size: 5338\n",
      "\u001b[33m[0] < Pushing hello-python [k.harbor.siat.ac.cn/openfaas/python-hello:1.0.0] done.\n",
      "\u001b[0m\u001b[33m[0] > Pushing hash-python [k.harbor.siat.ac.cn/openfaas/python-hash:1.0.0].\n",
      "\u001b[0mThe push refers to repository [k.harbor.siat.ac.cn/openfaas/python-hash]\n",
      "5222ea2b3e67: Preparing\n",
      "f3c10663d9b3: Preparing\n",
      "7874115f26a8: Preparing\n",
      "a0c05c58eae6: Preparing\n",
      "d9f89be3ea66: Preparing\n",
      "cc70af984b15: Preparing\n",
      "8630709fc03e: Preparing\n",
      "ff86a3cd7300: Preparing\n",
      "e1dcdd9b46b6: Preparing\n",
      "a4337db26919: Preparing\n",
      "2dfe3c85b996: Preparing\n",
      "f5f847464d89: Preparing\n",
      "4c488a561d6f: Preparing\n",
      "6c021b160968: Preparing\n",
      "6c021b160968: Preparing\n",
      "cd6b2a9ae627: Preparing\n",
      "84c97f2e3099: Preparing\n",
      "b0cb6a43f300: Preparing\n",
      "e1dcdd9b46b6: Waiting\n",
      "4b4c002ee6ca: Preparing\n",
      "cdc9dae211b4: Preparing\n",
      "a4337db26919: Waiting\n",
      "7095af798ace: Preparing\n",
      "fe6a4fdbedc0: Preparing\n",
      "2dfe3c85b996: Waiting\n",
      "e4d0e810d54a: Preparing\n",
      "4e006334a6fd: Preparing\n",
      "cc70af984b15: Waiting\n",
      "f5f847464d89: Waiting\n",
      "fe6a4fdbedc0: Waiting\n",
      "4b4c002ee6ca: Waiting\n",
      "e4d0e810d54a: Waiting\n",
      "84c97f2e3099: Waiting\n",
      "4e006334a6fd: Waiting\n",
      "4c488a561d6f: Waiting\n",
      "b0cb6a43f300: Waiting\n",
      "cdc9dae211b4: Waiting\n",
      "8630709fc03e: Waiting\n",
      "ff86a3cd7300: Waiting\n",
      "cd6b2a9ae627: Waiting\n",
      "6c021b160968: Waiting\n",
      "7874115f26a8: Layer already exists\n",
      "a0c05c58eae6: Layer already exists\n",
      "d9f89be3ea66: Layer already exists\n",
      "f3c10663d9b3: Layer already exists\n",
      "5222ea2b3e67: Layer already exists\n",
      "cc70af984b15: Layer already exists\n",
      "8630709fc03e: Layer already exists\n",
      "e1dcdd9b46b6: Layer already exists\n",
      "a4337db26919: Layer already exists\n",
      "ff86a3cd7300: Layer already exists\n",
      "2dfe3c85b996: Layer already exists\n",
      "4c488a561d6f: Layer already exists\n",
      "6c021b160968: Layer already exists\n",
      "f5f847464d89: Layer already exists\n",
      "cd6b2a9ae627: Layer already exists\n",
      "84c97f2e3099: Layer already exists\n",
      "b0cb6a43f300: Layer already exists\n",
      "4b4c002ee6ca: Layer already exists\n",
      "cdc9dae211b4: Layer already exists\n",
      "7095af798ace: Layer already exists\n",
      "fe6a4fdbedc0: Layer already exists\n",
      "e4d0e810d54a: Layer already exists\n",
      "4e006334a6fd: Layer already exists\n",
      "1.0.0: digest: sha256:86b1da69c4e1c5ef36d183aec2c8b33dff46c26572489450572c1d7c9febc32b size: 5338\n",
      "\u001b[33m[0] < Pushing hash-python [k.harbor.siat.ac.cn/openfaas/python-hash:1.0.0] done.\n",
      "\u001b[0m\u001b[33m[0] > Pushing sort-python [k.harbor.siat.ac.cn/openfaas/python-sort:1.0.0].\n",
      "\u001b[0mThe push refers to repository [k.harbor.siat.ac.cn/openfaas/python-sort]\n",
      "9a9fdb31762b: Preparing\n",
      "6297d92ea10b: Preparing\n",
      "7874115f26a8: Preparing\n",
      "a0c05c58eae6: Preparing\n",
      "d9f89be3ea66: Preparing\n",
      "cc70af984b15: Preparing\n",
      "8630709fc03e: Preparing\n",
      "ff86a3cd7300: Preparing\n",
      "e1dcdd9b46b6: Preparing\n",
      "a4337db26919: Preparing\n",
      "2dfe3c85b996: Preparing\n",
      "f5f847464d89: Preparing\n",
      "4c488a561d6f: Preparing\n",
      "6c021b160968: Preparing\n",
      "6c021b160968: Preparing\n",
      "cd6b2a9ae627: Preparing\n",
      "84c97f2e3099: Preparing\n",
      "b0cb6a43f300: Preparing\n",
      "4b4c002ee6ca: Preparing\n",
      "cdc9dae211b4: Preparing\n",
      "7095af798ace: Preparing\n",
      "fe6a4fdbedc0: Preparing\n",
      "e4d0e810d54a: Preparing\n",
      "8630709fc03e: Waiting\n",
      "4e006334a6fd: Preparing\n",
      "ff86a3cd7300: Waiting\n",
      "e1dcdd9b46b6: Waiting\n",
      "84c97f2e3099: Waiting\n",
      "4c488a561d6f: Waiting\n",
      "a4337db26919: Waiting\n",
      "cd6b2a9ae627: Waiting\n",
      "2dfe3c85b996: Waiting\n",
      "6c021b160968: Waiting\n",
      "f5f847464d89: Waiting\n",
      "b0cb6a43f300: Waiting\n",
      "e4d0e810d54a: Waiting\n",
      "4b4c002ee6ca: Waiting\n",
      "fe6a4fdbedc0: Waiting\n",
      "7095af798ace: Waiting\n",
      "cdc9dae211b4: Waiting\n",
      "4e006334a6fd: Waiting\n",
      "cc70af984b15: Waiting\n",
      "9a9fdb31762b: Layer already exists\n",
      "d9f89be3ea66: Layer already exists\n",
      "7874115f26a8: Layer already exists\n",
      "6297d92ea10b: Layer already exists\n",
      "a0c05c58eae6: Layer already exists\n",
      "cc70af984b15: Layer already exists\n",
      "8630709fc03e: Layer already exists\n",
      "e1dcdd9b46b6: Layer already exists\n",
      "ff86a3cd7300: Layer already exists\n",
      "a4337db26919: Layer already exists\n",
      "2dfe3c85b996: Layer already exists\n",
      "f5f847464d89: Layer already exists\n",
      "4c488a561d6f: Layer already exists\n",
      "cd6b2a9ae627: Layer already exists\n",
      "6c021b160968: Layer already exists\n",
      "84c97f2e3099: Layer already exists\n",
      "b0cb6a43f300: Layer already exists\n",
      "4b4c002ee6ca: Layer already exists\n",
      "7095af798ace: Layer already exists\n",
      "cdc9dae211b4: Layer already exists\n",
      "fe6a4fdbedc0: Layer already exists\n",
      "e4d0e810d54a: Layer already exists\n",
      "4e006334a6fd: Layer already exists\n",
      "1.0.0: digest: sha256:bbd19edb99223e8721fb8c3552609859ae3567d01c2bf192a2e2707d35061251 size: 5338\n",
      "\u001b[33m[0] < Pushing sort-python [k.harbor.siat.ac.cn/openfaas/python-sort:1.0.0] done.\n",
      "\u001b[0m\u001b[33m[0] > Pushing md5-python [k.harbor.siat.ac.cn/openfaas/python-md5:1.0.0].\n",
      "\u001b[0mThe push refers to repository [k.harbor.siat.ac.cn/openfaas/python-md5]\n",
      "60304b240d9c: Preparing\n",
      "85218857044c: Preparing\n",
      "7874115f26a8: Preparing\n",
      "a0c05c58eae6: Preparing\n",
      "d9f89be3ea66: Preparing\n",
      "cc70af984b15: Preparing\n",
      "8630709fc03e: Preparing\n",
      "ff86a3cd7300: Preparing\n",
      "e1dcdd9b46b6: Preparing\n",
      "a4337db26919: Preparing\n",
      "2dfe3c85b996: Preparing\n",
      "f5f847464d89: Preparing\n",
      "4c488a561d6f: Preparing\n",
      "6c021b160968: Preparing\n",
      "6c021b160968: Preparing\n",
      "cd6b2a9ae627: Preparing\n",
      "84c97f2e3099: Preparing\n",
      "ff86a3cd7300: Waiting\n",
      "b0cb6a43f300: Preparing\n",
      "4b4c002ee6ca: Preparing\n",
      "e1dcdd9b46b6: Waiting\n",
      "cdc9dae211b4: Preparing\n",
      "7095af798ace: Preparing\n",
      "a4337db26919: Waiting\n",
      "fe6a4fdbedc0: Preparing\n",
      "e4d0e810d54a: Preparing\n",
      "2dfe3c85b996: Waiting\n",
      "4e006334a6fd: Preparing\n",
      "cc70af984b15: Waiting\n",
      "f5f847464d89: Waiting\n",
      "cd6b2a9ae627: Waiting\n",
      "7095af798ace: Waiting\n",
      "6c021b160968: Waiting\n",
      "fe6a4fdbedc0: Waiting\n",
      "4c488a561d6f: Waiting\n",
      "4e006334a6fd: Waiting\n",
      "4b4c002ee6ca: Waiting\n",
      "b0cb6a43f300: Waiting\n",
      "e4d0e810d54a: Waiting\n",
      "8630709fc03e: Waiting\n",
      "cdc9dae211b4: Waiting\n",
      "d9f89be3ea66: Layer already exists\n",
      "a0c05c58eae6: Layer already exists\n",
      "7874115f26a8: Layer already exists\n",
      "60304b240d9c: Layer already exists\n",
      "85218857044c: Layer already exists\n",
      "cc70af984b15: Layer already exists\n",
      "8630709fc03e: Layer already exists\n",
      "ff86a3cd7300: Layer already exists\n",
      "e1dcdd9b46b6: Layer already exists\n",
      "a4337db26919: Layer already exists\n",
      "2dfe3c85b996: Layer already exists\n",
      "4c488a561d6f: Layer already exists\n",
      "f5f847464d89: Layer already exists\n",
      "6c021b160968: Layer already exists\n",
      "cd6b2a9ae627: Layer already exists\n",
      "84c97f2e3099: Layer already exists\n",
      "4b4c002ee6ca: Layer already exists\n",
      "b0cb6a43f300: Layer already exists\n",
      "cdc9dae211b4: Layer already exists\n",
      "7095af798ace: Layer already exists\n",
      "fe6a4fdbedc0: Layer already exists\n",
      "e4d0e810d54a: Layer already exists\n",
      "4e006334a6fd: Layer already exists\n",
      "1.0.0: digest: sha256:d3584257b5be77b5f3ff81d19d1ff96a5ca408a745ef701045ed7ac8e8d5198e size: 5338\n",
      "\u001b[33m[0] < Pushing md5-python [k.harbor.siat.ac.cn/openfaas/python-md5:1.0.0] done.\n",
      "\u001b[0m\u001b[33m[0] > Pushing cryptography-python [k.harbor.siat.ac.cn/openfaas/python-cryptography:1.0.0].\n",
      "\u001b[0mThe push refers to repository [k.harbor.siat.ac.cn/openfaas/python-cryptography]\n",
      "601a255fa697: Preparing\n",
      "f0bda84ac3f3: Preparing\n",
      "b843d8c0b1e3: Preparing\n",
      "0bc6f1bee0d6: Preparing\n",
      "d9f89be3ea66: Preparing\n",
      "cc70af984b15: Preparing\n",
      "8630709fc03e: Preparing\n",
      "ff86a3cd7300: Preparing\n",
      "e1dcdd9b46b6: Preparing\n",
      "a4337db26919: Preparing\n",
      "2dfe3c85b996: Preparing\n",
      "f5f847464d89: Preparing\n",
      "4c488a561d6f: Preparing\n",
      "6c021b160968: Preparing\n",
      "6c021b160968: Preparing\n",
      "cd6b2a9ae627: Preparing\n",
      "84c97f2e3099: Preparing\n",
      "b0cb6a43f300: Preparing\n",
      "4b4c002ee6ca: Preparing\n",
      "cdc9dae211b4: Preparing\n",
      "7095af798ace: Preparing\n",
      "fe6a4fdbedc0: Preparing\n",
      "e4d0e810d54a: Preparing\n",
      "4e006334a6fd: Preparing\n",
      "4c488a561d6f: Waiting\n",
      "6c021b160968: Waiting\n",
      "cc70af984b15: Waiting\n",
      "cd6b2a9ae627: Waiting\n",
      "8630709fc03e: Waiting\n",
      "4e006334a6fd: Waiting\n",
      "e4d0e810d54a: Waiting\n",
      "e1dcdd9b46b6: Waiting\n",
      "ff86a3cd7300: Waiting\n",
      "84c97f2e3099: Waiting\n",
      "a4337db26919: Waiting\n",
      "7095af798ace: Waiting\n",
      "2dfe3c85b996: Waiting\n",
      "fe6a4fdbedc0: Waiting\n",
      "b0cb6a43f300: Waiting\n",
      "f5f847464d89: Waiting\n",
      "4b4c002ee6ca: Waiting\n",
      "cdc9dae211b4: Waiting\n",
      "0bc6f1bee0d6: Layer already exists\n",
      "f0bda84ac3f3: Layer already exists\n",
      "601a255fa697: Layer already exists\n",
      "d9f89be3ea66: Layer already exists\n",
      "b843d8c0b1e3: Layer already exists\n",
      "cc70af984b15: Layer already exists\n",
      "8630709fc03e: Layer already exists\n",
      "ff86a3cd7300: Layer already exists\n",
      "e1dcdd9b46b6: Layer already exists\n",
      "a4337db26919: Layer already exists\n",
      "2dfe3c85b996: Layer already exists\n",
      "f5f847464d89: Layer already exists\n",
      "6c021b160968: Layer already exists\n",
      "cd6b2a9ae627: Layer already exists\n",
      "4c488a561d6f: Layer already exists\n",
      "84c97f2e3099: Layer already exists\n",
      "cdc9dae211b4: Layer already exists\n",
      "4b4c002ee6ca: Layer already exists\n",
      "7095af798ace: Layer already exists\n",
      "b0cb6a43f300: Layer already exists\n",
      "fe6a4fdbedc0: Layer already exists\n",
      "e4d0e810d54a: Layer already exists\n",
      "4e006334a6fd: Layer already exists\n",
      "1.0.0: digest: sha256:ca455779b43d1b2b17c27c476a9e64ed7bbf114f513daa9a17470e4d0343171d size: 5342\n",
      "\u001b[33m[0] < Pushing cryptography-python [k.harbor.siat.ac.cn/openfaas/python-cryptography:1.0.0] done.\n",
      "\u001b[0m\u001b[33m[0] Worker done.\n",
      "\u001b[0m\n",
      "Deploying: hash-python.\n",
      "WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS.\n",
      "\n",
      "Deployed. 202 Accepted.\n",
      "URL: http://serverless.siat.ac.cn:31112/function/hash-python\n",
      "\n",
      "Deploying: sort-python.\n",
      "WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS.\n",
      "\n",
      "Deployed. 202 Accepted.\n",
      "URL: http://serverless.siat.ac.cn:31112/function/sort-python\n",
      "\n",
      "Deploying: md5-python.\n",
      "WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS.\n",
      "\n",
      "Deployed. 202 Accepted.\n",
      "URL: http://serverless.siat.ac.cn:31112/function/md5-python\n",
      "\n",
      "Deploying: cryptography-python.\n",
      "WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS.\n",
      "\n",
      "Deployed. 202 Accepted.\n",
      "URL: http://serverless.siat.ac.cn:31112/function/cryptography-python\n",
      "\n",
      "Deploying: hello-python.\n",
      "WARNING! You are not using an encrypted connection to the gateway, consider using HTTPS.\n",
      "\n",
      "Deployed. 202 Accepted.\n",
      "URL: http://serverless.siat.ac.cn:31112/function/hello-python\n",
      "\n",
      "\n"
     ]
    }
   ],
   "source": [
    "update_openfaas(path_web)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4481b1e9-9f4c-41ed-b85e-c7858aa5ad36",
   "metadata": {},
   "outputs": [],
   "source": [
    "! kubectl get pod  -n openfaas-fn"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a28279f2-944b-4fa2-ab98-1e0d00240171",
   "metadata": {},
   "outputs": [],
   "source": [
    "! kubectl describe pod -n openfaas-fn bigdata-794cd4b49f-lz9v9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d4168b59-deb8-454f-a649-32df4f604a83",
   "metadata": {},
   "outputs": [],
   "source": [
    "action_names = ['hello-python', 'hash-python', 'cryptography-python', 'md5-python', 'sort-python']\n",
    "for i in action_names:\n",
    "    cmd = 'faas-cli remove {function}'\n",
    "    os.system(cmd.format(function=i))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "9aab921455daf93c5b5e512768862be38eb2d6dcc418fdb7d8b034605503ac32"
  },
  "kernelspec": {
   "display_name": "Python 3.8.8 64-bit ('base': conda)",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
